package com.zoiz.plus;

import java.lang.reflect.Method;

import com.zoiz.plus.extend.Transactional;

/**
 * Internal class which holds object instance, method and arguments' types.
 * 
 * @author Michael Liao (askxuefeng@gmail.com)
 */
class Action {

	/**
	 * Object instance.
	 */
	public final Object instance;

	/**
	 * Method instance.
	 */
	public final Method method;

	/**
	 * Method's arguments' types.
	 */
	public final Class<?>[] arguments;

	public final boolean transactional;

	public Action(Object instance, Method method) {
		this.instance = instance;
		this.method = method;
		this.arguments = method.getParameterTypes();
		this.transactional = method.getAnnotation(Transactional.class) == null ? false
				: true;
	}

}
